"""myobject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
#前台大堂点餐端子路由文件
from django.urls import path,include
from web.views import index,cart,orders

urlpatterns = [
    path('', index.index,name="index"),
    #前台登录
    path('login', index.login,name="web_login"),#加载登录表单
    path('dologin', index.dologin,name="web_dologin"),#执行登录
    path('logout', index.logout,name="web_logout"),#退出
    path('verify', index.verify,name="web_verify"),#输出验证码

    path('web/',include([
        path('',index.webindex,name="web_index"),

        path('cart/add/<str:pid>',cart.add,name="web_cart_add"),
        path('cart/delete/<str:pid>',cart.delete,name="web_cart_delete"),
        path('cart/clear',cart.clear,name="web_cart_clear"),
        path('cart/change',cart.change,name="web_cart_change"),

        path('orders/<int:pIndex>',orders.index,name="web_orders_index"),
        path('orders/insert',orders.insert,name="web_orders_insert"),
        path('orders/detail',orders.detail,name="web_orders_detail"),
        path('orders/status',orders.status,name="web_orders_status"),#修改订单状态
        ]))
]